package com.example.jmmconsumerkotlin.di.component

import android.app.Application
import com.example.jmmconsumerkotlin.di.model.ActModel
import com.example.jmmconsumerkotlin.di.model.ApplicationModule
import com.example.jmmconsumerkotlin.di.model.YstarModel
import com.ystarkotlin.application.YApplication
import dagger.BindsInstance
import dagger.Component
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton

/**
 * Created by Ystar
 *Data 2019/9/3
 */
@Singleton
@Component(
    modules = [
        AndroidSupportInjectionModule::class,
        ApplicationModule::class,
        ActModel::class,
        YstarModel::class
    ]
)
interface YstarAppCompoent : AndroidInjector<YApplication> {
    @Component.Builder
    interface Builder {
        @BindsInstance
        fun application(application: Application): YstarAppCompoent.Builder  //将Application 注入 可以在module里面使用

        fun build(): YstarAppCompoent
    }


}